services:
    spqr-shard-image:
        image: spqr-shard-image
        build:
            dockerfile: ./docker/shard/Dockerfile
            context: .
    spqr-base-image:
        image: spqr-base-image
        build:
            dockerfile: ./docker/spqr/Dockerfile
            context: .
    shard1:
        image: spqr-shard-image
        environment:
            - POSTGRES_USER=user1
            - POSTGRES_DB=db1
        ports:
            - "7432:6432"
        hostname: spqr_shard_1
        container_name: spqr_shard_1
    shard2:
        image: spqr-shard-image
        environment:
            - POSTGRES_USER=user1
            - POSTGRES_DB=db1
        ports:
            - "7433:6432"
        hostname: spqr_shard_2
        container_name: spqr_shard_2
    coordinator:
        build:
            dockerfile: ./docker/coordinator/Dockerfile
            context: .
        ports:
            - "7002:7002"
            - "7003:7003"
        hostname: spqr_coordinator
        container_name: spqr_coordinator
        depends_on: 
            - qdb01
    qdb01:
        image: 'bitnami/etcd:latest'
        container_name: spqr_qdb_0_1
        hostname: spqr_qdb_0_1
        environment:
            ALLOW_NONE_AUTHENTICATION: "yes"
            ETCD_LOG_LEVEL: "debug"
        ports:
            - "2379:2379"
    router:
        build:
            dockerfile: ./docker/router/Dockerfile
            context: .
        ports:
            - "8432:6432"
            - "7013:7000"
        hostname: spqr_router_1_1
        container_name: spqr_router_1_1
        environment:
            - ROUTER_CONFIG=/spqr/docker/router/cfg.yaml
            - COORDINATOR_CONFIG=/spqr/docker/coordinator/cfg.yaml
            - ROUTER_LOG='router.log'
    router2:
        build:
            dockerfile: ./docker/router/Dockerfile
            context: .
        ports:
            - "8433:6432"
            - "7023:7003"
        hostname: spqr_router_1_2
        container_name: spqr_router_1_2
        environment:
            - ROUTER_CONFIG=/spqr/docker/router/cfg2.yaml
            - COORDINATOR_CONFIG=/spqr/docker/coordinator/cfg2.yaml
            - ROUTER_LOG='router.log'
    slicer:
        build:
            dockerfile: ./docker/slicer/Dockerfile
            context: .
